home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1992-11-18 | 42.1 KB | 1,159 lines | [ TEXT/MPS ]
C.S.M.P. Digest Tue, 31 Mar 92 Volume 1 : Issue 39 Today's Topics: Think C 4.0.5 malloc problem. Please help. Learning Mac programming, API, Toolbox, etc. TC5.0 and Colortoolbox How to find chooser user name? Need help plotting 'icl8's Still can't get CScrollPane to work... HELP! Accessing open serial port (Q) oopsDebug problem in THINK C 5.0.2 Powerbook Watch The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly. These digests are available (by using FTP, account anonymous, your email address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon. edu. This is also the home of the comp.sys.mac.programmer Frequently Asked Questions list. These digests are also available via email. Just send a note saying that you want to be on the digest mailing list to mkelly@cs.uoregon.edu, and you will automatically receive each new digest as it is created. The articles in these digests are taken directly from comp.sys.mac.programmer. They are not edited; all articles included in this digest are in their original posted form. The only articles that are -not- included in these digests are those which didn't receive any replies (except those that give information rather than ask a question). All replies to each article are concatenated onto the original article in the order in which they were received. Article threads are not added to the digests until the last article added to the thread is at least one month old (this is to ensure that the thread is dead before adding it to the digests). Send administrative mail to mkelly@cs.uoregon.edu. ------------------------------------------------------- From: vvann@umbio.med.miami.edu (Vince Vann) Subject: Think C 4.0.5 malloc problem. Please help. Organization: University of Miami Medical School Date: Sat, 29 Feb 1992 17:54:53 GMT dougs@eng.umd.edu (Douglas W. Sauder) writes: >Can anyone tell me why the following program gives an allocation error >when I input a value for n > 3000 ? It doesn't matter how much memory >I specify for the multifinder partition. > #include <stdio.h> > #include <stdlib.h> > double *dvector(int,int); > main() > { > int i,n; > double *x; > printf("Enter n: "); > scanf("%d",&n); > x = (double *) malloc(n*sizeof(double)); > if (x == NULL) { > printf("Allocation error\n"); > exit(-1); > } > for (i=0; i<n; ++i) > x[i] = i; > printf("Done\n"); > } The variable 'n' is declared as a signed short int, so (n * sizeof(double)) yields a signed short int. Because malloc expects an unsigned long integer (type size_t) the expression result is automatically sign extended before conversion to the unsigned long. Therefore, when you request over 32767 (0x7FFF) bytes you get a sign extended long integer that is HUGE and the malloc() request fails. In short, you need to cast 'n' to a long before the multiplication takes place, or declare 'n' as an unsigned long in the first place. Try either of the following: malloc( (long) n * sizeof(double) ) malloc( (unsigned long) n * sizeof(double) ) Both should work since long multiplication will occur in both cases, although the 2nd line is technically what you want. /===================================\ /================================\ | Vincent R. Vann | "Great spirits have always | | Univ. of Miami School of Medicine | encounterd violent opposition | | Miami, Florida | from mediocre minds..." | | | | | vvann@umbio.med.miami.edu | -- Albert Einstein | \===================================/ \================================/ -- --------------------------- Organization: University of Illinois at Chicago Date: Saturday, 22 Feb 1992 15:48:36 CST From: <U20565@uicvm.uic.edu> Subject: Learning Mac programming, API, Toolbox, etc. I would like to get started on Mac programming. I come from the PC world, Windows programming, and basically was wondering if there was some definitive text on C programming on the Mac. If any of you have done Windows programming a book authored by Charles Petzold, "Programming Windows" is The Bible in Windows programming circles. It specifically goes over the "pull your hair out" event and function driven side of C programming. I don't want high level crap like Hypercard (from a real programmer's standpoint). THINK C and RESEDIT are on my list of things to obtain, now I need a REALLY good book to cover it all. I would appreciate any recommendations, please respond directly if you can. Thanks, Mario Pacheco "Spanish Fly" - ------------------------- From: andrews@sp1.csrd.uiuc.edu (John Andrews) Subject: Learning Mac programming, API, Toolbox, etc. Organization: UIUC Center for Supercomputing Research and Development Date: Mon, 24 Feb 92 03:42:40 GMT This is an FAQ in this newsgroup, but I am going to give a somewhat heretical answer. You need Inside Mac (from Apple), which is a six volume set. MacZone carried it last time I needed to buy a volume, and their prices are good. You can get pretty far with just volume I, and very far with volumes I and II. After you've done some basic programming with these, you can probably figure out whether you need any of the other volumes (I've got I thru V, but use I 90% of the time). Next, I would grab the sample code from ftp.apple.com and study it after becoming familiar with volume I of IM. Third, I would get Think Reference from Symantec (although I suspect they will be issuing a new release soon, and charging 50% of the purchase price for the upgrade). I think that this is all you need (this is the heresy). However, if you have lots of money, and want to wade through a lot of text to get to the occasional extra insight that is offered, there are half a dozen books that are commonly recommended for mac programming. I've studied them in the bookstore (after doing some of my own program), and I'm not impressed, especially when it seems like you have to buy 2 or 3 of them to get the whole picture. I don't see why most of what you need can't be explained in one book. I bought "Macintosh Programming Secrets" by Scott Knaster because it was recommended in my Think C manual, but it was a waste of money. -- John Andrews (andrews@csrd.uiuc.edu) "He who dies with the shortest .sig, wins" Graduate Research Assistant, Center for Supercomputing R&D, Urbana, IL - ------------------------- From: dougm@descartes.cns.caltech.edu (Doug McNaught) Subject: Learning Mac programming, API, Toolbox, etc. Date: 24 Feb 92 13:35:22 GMT Organization: California Institute of Technology In article <1992Feb24.034240.16056@csrd.uiuc.edu> andrews@sp1.csrd.uiuc.edu (John Andrews) writes: > >I think that this is all you need (this is the heresy). However, if you have >lots of money, and want to wade through a lot of text to get to the occasional >extra insight that is offered, there are half a dozen books that are commonly >recommended for mac programming. I've studied them in the bookstore (after >doing some of my own program), and I'm not impressed, especially when it seems >like you have to buy 2 or 3 of them to get the whole picture. I don't see why >most of what you need can't be explained in one book. I bought "Macintosh >Programming Secrets" by Scott Knaster because it was recommended in my Think C >manual, but it was a waste of money. I certainly agree about IM being sufficient--I learned most of what I know from the "phone book" edition that was sold with MDS back in '84-'85. But I found both of Scott Knaster's books very useful, as well as entertaining. I would particularly recommend _How to Write Macintosh Software_ for anyone who occasionally writes programs with bugs--it's a very good guide to what causes your program to crash, and provides a good synthesis of the myriad details scattered through the various volumes of _Inside Mac_. regards, doug -- <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><> <> Doug McNaught dougm@descartes.caltech.edu <> <> Help!!! I'm addicted to *Spaceward Ho!* Is there a support group? <> <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><> - ------------------------- From: greeny@top.cis.syr.edu (Jonathan Greenfield) Subject: Learning Mac programming, API, Toolbox, etc. Organization: CIS Dept., Syracuse University Date: Mon, 24 Feb 92 08:51:22 EST In article <1992Feb24.034240.16056@csrd.uiuc.edu> andrews@sp1.csrd.uiuc.edu (John Andrews) writes: >This is an FAQ in this newsgroup, but I am going to give a somewhat heretical >answer. You need Inside Mac (from Apple), which is a six volume set. MacZone >carried it last time I needed to buy a volume, and their prices are good. >You can get pretty far with just volume I, and very far with volumes I and II. >After you've done some basic programming with these, you can probably figure >out whether you need any of the other volumes (I've got I thru V, but use I >90% of the time). If you are going to do System 7 programming, then IM VI is essential. I would recommend getting IM I and IM VI, together with the *free* IM I-V HyperCard stack (as well as the Tech. Notes stack) at ftp.apple.com. I did it this way and it worked out quite well. Once you get into stuff, you will be able to decide for yourself what else to get. (I decided to get the rest of the volumes, becuase there is nothing like information at your fingertips.) >I think that this is all you need (this is the heresy). However, if you have >lots of money, and want to wade through a lot of text to get to the occasional >extra insight that is offered, there are half a dozen books that are commonly >recommended for mac programming. I've studied them in the bookstore (after >doing some of my own program), and I'm not impressed, especially when it >seems like you have to buy 2 or 3 of them to get the whole picture. I don't >see why most of what you need can't be explained in one book. I bought >"Macintosh Programming Secrets" by Scott Knaster because it was recommended >in my Think C manual, but it was a waste of money. I found the Macintosh Programming Primer (comes in both Pascal and C flavors) to be very helpful as an introduction. But once it gets you going, you will very quickly want to put it down, and just use IM. I would recommend that you try to find the Mac Programming Primer in a library. If you really like it, you can always buy your own copy. The "Macintosh Revealed" series by Chernicoff are highly acclaimed, but I've never used them. You might want to check them out of the library, too. -- J. S. Greenfield greeny@top.cis.syr.edu (I like to put 'greeny' here, but my d*mn system wants a *real* name!) "What's the difference between an orange?" - ------------------------- From: d88-jwa@hemul.nada.kth.se (Jon W{tte) Subject: Learning Mac programming, API, Toolbox, etc. Date: 24 Feb 92 15:56:40 GMT Organization: Royal Institute of Technology, Stockholm, Sweden .syr.edu> greeny@top.cis.syr.edu (Jonathan Greenfield) writes: If you are going to do System 7 programming, then IM VI is essential. I would recommend getting IM I and IM VI, together with the *free* IM I-V HyperCard stack (as well as the Tech. Notes stack) at ftp.apple.com. I I'm getting QUITE tired on people trying to weasel out of buying IM VI by saying "it's only for System 7." It isn't. A LOT of what it says has to do with such things as system 6, multifinder, HFS (Sys 3.2...) the Sound Manager (6.0.5) Gestalt (6.0.5 too ?) WaitNextEvent (all 6.0) IM VI is VERY MUCH NEEDED since long. It should have been two volumes, one called VI and released 2-3 years ago, covering system 6.0 features and a lot of the quickdraw stuff. (32bit QD is available for 6.0 too) and the other called VII and documenting system 7 exclusive features. How can you get by without the HOpenResFilem, HCreate etc file mgr functions ? They're available from 3.2 and up, but documented only in IM VI. (and TechNote 218) -- This Signature is distributed under the conditions of the Signature License, available at a fee from h+@nada.kth.se (Jon W{tte) Reading the Signature implies that you accept to be bound by the terms in said License. Should you not agree on any of these terms, you must return the Signature unread to me. - ------------------------- From: aland@chaos.cs.brandeis.edu (Alan D.) Subject: Learning Mac programming, API, Toolbox, etc. Organization: As little as possible Date: Tue, 25 Feb 1992 06:24:47 GMT >I would like to get started on Mac programming. I come from the PC world, >Windows programming, and basically was wondering if there was some >definitive text on C programming on the Mac. If any of you have done Windows >programming a book authored by Charles Petzold, "Programming Windows" is >The Bible in Windows programming circles. >It specifically goes over the "pull your hair out" event and function driven >side of C programming. I don't want high level crap like Hypercard (from a >real programmer's standpoint). There is no single definitive book on the Mac programming, but there are a few that come close. One I'm using now which is good is "Using the Macintosh Toolbox with C 2nd edition" by Fred A. Huxham, David Burnard, and Jim Takatsuka, Sybex, ISBN: 0-89588-572-7. I have found this to be an excellent reference guide... Other books I have found helpful are the Macintosh Programming Primer Vol. 1, 2nd Edition by Dave Mark and Cartwright Reed (Addison-Wesley). I haven't gotten volume 2, because I'm really not interested in graphics and that is what it seems to cover the most, in my limited scan. I happened to stop by a store that was going out of business, and picked up "Programming for System 7" (Little & Swihart, Addison-Wesley) and Macintosh C Programming by Example (Kurt W. Matthies and Thom Hogan, Microsoft Press) but have not yet opened either. :) The Matthies and Hogan book was built upon some MacUser programming columns they wrote, starting (I believe) in 1990. The articles were interesting when I read them, and since I didn't have all of them, I took advantage of the chance to get the book cheap. :) I'd be interested in hearing what people consider to be a "definitive" book on Mac programming... Other than _Inside_Mac_1-6_, that is. :) -=Alan - ------------------------- From: sshws@convx1.lerc.nasa.gov (Herb Schilling) Subject: Learning Mac programming, API, Toolbox, etc. Date: 25 Feb 92 12:40:32 GMT Organization: NASA Lewis Research Center In article <1992Feb24.133522.13397@cco.caltech.edu> dougm@descartes.cns.caltech.edu (Doug McNaught) writes: But I >found both of Scott Knaster's books very useful, as well as entertaining. I >would particularly recommend _How to Write Macintosh Software_ for anyone who >occasionally writes programs with bugs--it's a very good guide to what causes >your program to crash, and provides a good synthesis of the myriad details >scattered through the various volumes of _Inside Mac_. By the way, the 3rd edition of this book is due out in June. Includes System 7 info. -- Herb Schilling , NASA Lewis Research Center , 21000 Brookpark Road, MS 142-5 Cleveland, Ohio 44135 . (216) 433-8955 sshws@convx1.lerc.nasa.gov - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: Learning Mac programming, API, Toolbox, etc. Date: 27 Feb 92 01:01:01 GMT Organization: Apple Computer Inc., Cupertino, CA In article <D88-JWA.92Feb24165640@hemul.nada.kth.se> d88-jwa@hemul.nada.kth.se (Jon W{tte) writes: >.syr.edu> greeny@top.cis.syr.edu (Jonathan Greenfield) writes: > > If you are going to do System 7 programming, then IM VI is essential. I > would recommend getting IM I and IM VI, together with the *free* IM I-V > HyperCard stack (as well as the Tech. Notes stack) at ftp.apple.com. I > > >I'm getting QUITE tired on people trying to weasel out of buying IM VI >by saying "it's only for System 7." It isn't. A LOT of what it says has >to do with such things as system 6, multifinder, HFS (Sys 3.2...) the >Sound Manager (6.0.5) Gestalt (6.0.5 too ?) WaitNextEvent (all 6.0) > >IM VI is VERY MUCH NEEDED since long. It should have been two volumes, >one called VI and released 2-3 years ago, covering system 6.0 features >and a lot of the quickdraw stuff. (32bit QD is available for 6.0 too) >and the other called VII and documenting system 7 exclusive features. Hmmm....Inside Mac VII covering System 7. How appropriate... > >How can you get by without the HOpenResFilem, HCreate etc file mgr >functions ? They're available from 3.2 and up, but documented only in >IM VI. (and TechNote 218) I just wanted to make one small clarification here. Routines like HOpenResFile and HCreate are library routines. They are not part of any system. Some of those routines, such as HOpenResFile and HCreateResFile do have trap numbers associated with them, but those traps are implemented only under System 7.0. The glue checks for those traps, and calls them if they are implemented. Otherwise, the call is fully executed in the glue. In order to use these library routines, you will need more than System 3.2 (or any system supporting HFS). You will also need either MPW 3.0 or greater, THINK C 4.0 or greater, or THINK Pascal 3.0 or greater. -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... - ------------------------- From: d88-jwa@hemul.nada.kth.se (Jon W{tte) Subject: Learning Mac programming, API, Toolbox, etc. Date: 27 Feb 92 13:24:38 GMT Organization: Royal Institute of Technology, Stockholm, Sweden > keith@Apple.COM (Keith Rollin) writes: [ HOpenResFile et al ] In order to use these library routines, you will need more than System 3.2 (or any system supporting HFS). You will also need either MPW 3.0 or greater, THINK C 4.0 or greater, or THINK Pascal 3.0 or greater. Yes, but all of those are old realeases, several years old. Everyone should have and run those releases... -- This Signature is distributed under the conditions of the Signature License, available at a fee from h+@nada.kth.se (Jon W{tte) Reading the Signature implies that you accept to be bound by the terms in said License. Should you not agree on any of these terms, you must return the Signature unread to me. - ------------------------- From: David.Peck@f421.n109.z1.fidonet.org (David Peck) Subject: LEARNING MAC PROGRAMMING, API, TOOLBOX, ETC Date: Sat, 29 Feb 1992 16:43:57 -0500 Hi. I'm David Peck... I just started Mac Programming too... The first thing you really want to get is the 6 volumes of Inside Macintosh, published by Addison Wesley. They cover _EVERYTHING_.... all the Mac Toolbox calls. However, you're programming in C... they're written with demo programs for PASCAL, so you'll have to have a stable knowledge of Pascal. I hear that Apple is rewriting the books for C, and they should be released sometime soon, I don't know when. As for a definate 'C' text, I'm not sure of one... --------------------------- From: PS9ZRHMC@MIAMIU.BITNET (Peter Sweeney) Subject: TC5.0 and Colortoolbox Date: 27 Feb 92 04:15:30 GMT Organization: Miami University - Academic Computer Service So, I'm using Think C 5.0.2 and I'd like to use Color Quickdraw routines and such. I'm specifically hung up on using HSVColor. What should I #include? There is no ColorToolbox.h with Think C 5.0. Rats. Where can I find HSVColor? Thanks in advance. any response is welcome. Peter S. ps9zrhmc@miamiu.acs.muohio.edu - ------------------------- From: vvann@umbio.med.miami.edu (Vince Vann) Subject: TC5.0 and Colortoolbox Date: 28 Feb 92 22:04:47 GMT Organization: University of Miami Medical School PS9ZRHMC@MIAMIU.BITNET (Peter Sweeney) writes: >So, I'm using Think C 5.0.2 and I'd like to use Color >Quickdraw routines and such. I'm specifically >hung up on using HSVColor. > >What should I #include? There is no ColorToolbox.h >with Think C 5.0. Rats. Where can I find HSVColor? > The file "Quickdraw.h" is #include'd automatically if you are using the MacHeaders precompiled header file. This allows you to make any Quickdraw calls that you want, either B/W or Color. It is your job to make sure that Color QuickDraw is available before you call any color routines from your code. To use HSV colors you need to #include "Picker.h" (the header file for the ColorPicker routines, see IM Vol5). This file is not included automatically by MacHeaders (unless you modify the file). To convert between RGB and HSV colors, use the routines RGB2HSV() and HSV2RGB. /===================================\ /================================\ | Vincent R. Vann | "Great spirits have always | | Univ. of Miami School of Medicine | encounterd violent opposition | | Miami, Florida | from mediocre minds..." | | | | | vvann@umbio.med.miami.edu | -- Albert Einstein | \===================================/ \================================/ --------------------------- From: bitting-douglas@CS.YALE.EDU (Douglas Bitting) Subject: How to find chooser user name? Organization: You gotta be kidding me! Date: Fri, 28 Feb 1992 11:44:53 GMT Hi... got another quick question. How does one find out what the chooser "User Name" is (equivalent would be Macintosh Owner in Sys7)? I would like to be able to do this under both sys6 and sys7. I have looked through everyplace I could think of, but I couldn't find any hints on how to do this. Thanks much! --Doug -- ...Doug Bitting... || "But the wisdom that comes from heaven is first || of all pure; then peace loving, considerate, bitting@cs.yale.edu || submissive, full of mercy, and good fruit, doug@yalevm.bitnet || impartial and sincere." -- James 3:17 -- -- Minnie Mouse is a slow maze learner. - ------------------------- From: reuter (Ron Reuter) Subject: How to find chooser user name? Date: 28 Feb 92 19:06:52 GMT Organization: USWest MRG In article <1992Feb28.164500.23742@cs.yale.edu>, bitting-douglas@CS.YALE.EDU (Douglas Bitting) writes: > > > Hi... got another quick question. How does one find out what the > chooser "User Name" is (equivalent would be Macintosh Owner in Sys7)? > I would like to be able to do this under both sys6 and sys7. I have > looked through everyplace I could think of, but I couldn't find any > hints on how to do this. Here's an XCMD to do the job: pascal void main( paramPtr ) XCmdBlockPtr paramPtr; { StringHandle chosen; chosen = GetString( -16096); HLock(chosen); *paramPtr->returnValue = PtoCstr( (char *) *chosen); HUnlock(chosen); return; } --------------------------- From: todd@lightning.Columbia.NCR.COM (Todd Sellers) Subject: Need help plotting 'icl8's Organization: NCR Corp - MCPD, O&D-Columbia, Columbia, SC Date: Fri, 28 Feb 92 18:41:07 GMT Does anyone out there in netland have any routines for plotting icl8 resources? I am using the desktop database and PtrToHand to get a handle to the icl8 icons, but have yet to be able to get them plotted on the screen. I have read the Technical Note about plotting icons, but there are only two routines listed. One for plotting an icon with a given resource ID and another for plotting a 'cicn'. I would certainly appreciate any help and/or pointers. Thanks in advance for all your help! Todd - ------------------------- From: tagreen@bronze.ucs.indiana.edu (Todd Green) Subject: Need help plotting 'icl8's Date: 28 Feb 92 20:26:15 GMT Organization: Indiana University In article <1992Feb28.134107.1161@ncrcae.ColumbiaSC.NCR.COM> todd@lightning.Columbia.NCR.COM (Todd Sellers) writes: >Does anyone out there in netland have any routines for plotting icl8 >resources? I am using the desktop database and PtrToHand to get Here is a .h file that will work under sys 7. It is based on Tech Note 306. (If there is a _real_ .h file by Apple I'd love to know where you can get it). If you are interested in routines that will work under sys6 I wrote a library some time ago (read I look back at it and cringe, but it works find). Email and I'll send you a copy. /*********************************************************** Created: Tuesday, January 7, 1992 at 3:09 PM ColorIcons.h C Interface to the Macintosh Libraries Based on Tech Note 306 provided by Apple Computer, Inc. by Todd A. Green ***********************************************************/ #ifndef __QUICKDRAW__ #include <Quickdraw.h> #endif typedef short IconAlignmentType; typedef short IconTransformType; enum { /* IconTransformType values */ ttNone = 0x0, ttDisabled = 0x1, ttOffline = 0x2, ttOpen = 0x3, ttSelected = 0x4000, ttSelectedDisabled = (ttSelected | ttDisabled), ttSelectedOffline = (ttSelected | ttOffline), ttSelectedOpen = (ttSelected | ttOpen) }; enum { /* Label Color Transforms */ ttLabel0 = 0x0000, ttLabel1 = 0x0100, ttLabel2 = 0x0200, ttLabel3 = 0x0300, ttLabel4 = 0x0400, ttLabel5 = 0x0500, ttLabel6 = 0x0600, ttLabel7 = 0x0700 }; pascal OSErr PlotIconID(Rect *rect, IconAlignmentType align, IconTransformType transform, short resID) = {0x303C, 0x0500, 0xABC9}; pascal OSErr PlotCIconHandle(Rect *rect, IconAlignmentType align, IconTransformType transform, CIconHandle cIcon) = {0x303C, 0x061F, 0xABC9}; Todd -- Internet: tagreen@bronze.ucs.indiana.edu NeXTMail: tagreen@marmoset.ucs.indiana.edu Bitnet: tagreen@iubacs.bitnet - ------------------------- From: minow@ranger.enet.dec.com (Martin Minow) Subject: Need help plotting 'icl8's Date: 29 Feb 92 15:50:57 GMT Organization: Digital Equipment Corporation In article <1992Feb28.134107.1161@ncrcae.ColumbiaSC.NCR.COM>, todd@lightning.Columbia.NCR.COM (Todd Sellers) writes... >Does anyone out there in netland have any routines for plotting icl8 >resources? This works on System 7 only: you'll have to write PlotSystem6Icon: See Tech Note 306 for the details. This was retyped from working code (Think 5.0.2 and MPW 3.2), my apologies for any typing errors. Martin Minow minow@ranger.enet.dec.com typedef enum { ttNone = 0, /* No hilite */ ttDisabled = 1, /* Disabled icon */ ttOffline = 2, /* Offline device */ ttOpen = 3, /* Online device */ ttSelected = 0x4000, /* User clicked on this */ ttSelectedDisabled = (ttSelected | ttDisabled), ttSelectedOffline = (ttSelected | ttOffline), ttSelectedOpen = (ttSelected | ttOpen) } IconTransformType; typedef enum { ttDefaultAlignment = 0 } IconAlignmentType; pascal OSErr PlotIconID( /* Glue from TN 306 */ Rect *theRect, IconAlignmentType align, IconTransformType transform, short theResId ) = { 0x303C, 0x0500, 0xABC9 }; /* * To use this, create an entire icon family (ICN# and ics#). The * System 7 icon plotter chooses the correct size and color depth. */ OSErr PlotColorIcon( Rect *theRect; /* Draw it here */ IconAlignmentType align; /* Alignment type */ IconTransformType transform; /* Transform: see above */ short theResID /* Icon family ID */ ) { SysEnvRec theSystem; OSErr status; if (SysEnvirons(1, &theSystem) != noErr || theSystem.systemVersion < 0x0700) status = PlotSystem6Icon(theRect, transform, theResID); else { status = PlotIconID(theRect, align, transform, theResID); } return (status); } My version of PlotSystem6Icon only draws the black/white icon; this gives the user an incentive to upgrade. --------------------------- From: chait@cs.umass.edu Subject: Still can't get CScrollPane to work... HELP! Date: 28 Feb 92 22:02:10 GMT Organization: COINS, UMass, Amherst Thanks to the people who responded to my first message. Basically, everyone told me to go look at the TCL demos, which I had done, went and did again, and I'm still no closer to figuring out how to get my scroll bars to magically appear and how to update them correctly. Here's my problem: I've initialized a CPanorama, and a CScrollPane, and have made sure that I'm telling CScrollPane that I want scroll bars. I use ChangeSize on the CPanorama as I add objects (is this in pane scale or in pixels?), and then I make especially sure that I AdjustScrollMax and Calibrate the CScrollPane. Noting happens. My graphics still go off the edge of the pane without a darn scroll bar to let me see the rest. WHAT AM I NOT DOING? WHAT DO I NEED TO KNOW ABOUT USING CSCROLLPANE TO MAKE IT WORK RIGHT? (sorry to yell, but I REALLY need a response quickly ;) Thanks in advance to all who respond, Dave Chait Frustrated TCL User - ------------------------- From: wysocki@husc.harvard.edu (Chris Wysocki) Subject: Still can't get CScrollPane to work... HELP! Date: 29 Feb 92 01:01:33 GMT Organization: Harvard University, Cambridge, MA In article <44117@dime.cs.umass.edu>, chait@cs.umass.edu writes: > Here's my problem: I've initialized a CPanorama, and a CScrollPane, and > have made sure that I'm telling CScrollPane that I want scroll bars. > I use ChangeSize on the CPanorama as I add objects (is this in pane scale > or in pixels?), and then I make especially sure that I AdjustScrollMax and > Calibrate the CScrollPane. > > Noting happens. My graphics still go off the edge of the pane without a > darn scroll bar to let me see the rest. WHAT AM I NOT DOING? WHAT DO I > NEED TO KNOW ABOUT USING CSCROLLPANE TO MAKE IT WORK RIGHT? > (sorry to yell, but I REALLY need a response quickly ;) Instead of ChangeSize, you should call the SetBounds method of CPanorama to adjust the overall extent of the Panorama. Note that this method calls itsScrollPane->AdjustScrollMax, so you don't need to bother doing this yourself. Hope this helps, Chris Wysocki wysocki@husc.harvard.edu - ------------------------- From: stevenj@athena.mit.edu (Steven G Johnson) Subject: Still can't get CScrollPane to work... HELP! Organization: Massachusetts Institute of Technology Date: Sat, 29 Feb 1992 04:53:08 GMT >In article <44117@dime.cs.umass.edu>, chait@cs.umass.edu writes: > >> Here's my problem: I've initialized a CPanorama, and a CScrollPane, and >> have made sure that I'm telling CScrollPane that I want scroll bars. >> I use ChangeSize on the CPanorama as I add objects (is this in pane scale >> or in pixels?), and then I make especially sure that I AdjustScrollMax and >> Calibrate the CScrollPane. >> >> Noting happens. My graphics still go off the edge of the pane without a >> darn scroll bar to let me see the rest. WHAT AM I NOT DOING? WHAT DO I >> NEED TO KNOW ABOUT USING CSCROLLPANE TO MAKE IT WORK RIGHT? >> (sorry to yell, but I REALLY need a response quickly ;) > >Instead of ChangeSize, you should call the SetBounds method of CPanorama to >adjust the overall extent of the Panorama. Note that this method calls >itsScrollPane->AdjustScrollMax, so you don't need to bother doing this >yourself. > You have to call the InstallPanorama method of CScrollPane (passing your panorama). I'm assuming you've set things up correctly with the panorama as a sub-pane of the scroll pane. Also, doesn't the IPane method (when you add objects) automatically adjust the bounds of the panorama (via the panorama's AddSubView method)? I have a feeling that it does, but I could be wrong--I don't have the source code in front of me right now. That way you wouldn't have to call SetBounds. Cordially, Steven G. Johnson --------------------------- From: fridberg@alcvax.pfc.mit.edu Subject: Accessing open serial port (Q) Date: 28 Feb 92 22:44:28 GMT Organization: Massachvsetts Institvte of Technology Hi netters! I am writing a programm which would be looking into serial port open by WhiteKnight (or another terminal emulator) and do some action when it detects sertain simbols/words. The question is: how one can acsess already open serial port and and read from it without being noticed? Any help/hints/soutce code would be greatly appreciated. Thanks in advance, Mike. - ------------------------- From: neeri@iis.ethz.ch (Matthias Ulrich Neeracher) Subject: Accessing open serial port (Q) Organization: Integrated Systems Laboratory, ETH, Zurich Date: 29 Feb 92 17:18:33 In article <1992Feb28.174428.1@alcvax.pfc.mit.edu> fridberg@alcvax.pfc.mit.edu writes: >Hi netters! >I am writing a programm which would be looking into serial port open by >WhiteKnight (or another terminal emulator) and do some action when it detects >sertain simbols/words. The question is: how one can acsess already open >serial port and and read from it without being noticed? Patch the _Read trap and check whether it is for the serial driver. Or replace the serial driver's address in the unit table with your own address. Matthias - --- Matthias Neeracher neeri@iis.ethz.ch "One fine day in my odd past..." -- Pixies, _Planet of Sound_ - ------------------------- From: russotto@eng.umd.edu (Matthew T. Russotto) Subject: Accessing open serial port (Q) Date: Sun, 01 Mar 92 02:02:33 GMT Organization: University of Maryland, College Park, College of Engineering In article <1992Feb28.174428.1@alcvax.pfc.mit.edu> fridberg@alcvax.pfc.mit.edu writes: >Hi netters! >I am writing a programm which would be looking into serial port open by >WhiteKnight (or another terminal emulator) and do some action when it detects >sertain simbols/words. The question is: how one can acsess already open >serial port and and read from it without being noticed? >Any help/hints/soutce code would be greatly appreciated. >Thanks in advance, Intercept the read routine by modifying the driver control entry for the port. If a synchronous call is made, call the real read and get the characters out of the buffer. If the call is asynchronous, save the address of the real completion routine somewhere ('where' left as an exercise :-).-- careful, _Read can be called at interrupt time, I think), intercept it with your completion routine which gets the characters and calls the real completion routine, and then call the real read. -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu Some news readers expect "Disclaimer:" here. Just say NO to police searches and seizures. Make them use force. (not responsible for bodily harm resulting from following above advice) - ------------------------- From: daven@notable.com (Dave Newman) Subject: Accessing open serial port (Q) Date: 1 Mar 92 03:37:31 GMT Organization: Notable Technologies In article <1992Feb28.174428.1@alcvax.pfc.mit.edu> (comp.sys.mac.programmer), fridberg@alcvax.pfc.mit.edu writes: | Hi netters! | I am writing a programm which would be looking into serial port open by | WhiteKnight (or another terminal emulator) and do some action when it detects | sertain simbols/words. The question is: how one can acsess already open | serial port and and read from it without being noticed? | Any help/hints/soutce code would be greatly appreciated. | Thanks in advance, You can do this fairly easily with MicroPhone II and a XCMD (or XFCN) that you write. MicroPhone II supports callbacks which allow a XCMD to read and write from the open serial port. -- Dave - --------------------------------------------------------- Dave Newman | AOL: AFC Tinman Artillery Spotter | CIS: 70743,3323 Notable Technologies, Inc. | internet: daven@notable.com 510.208.4449 | FAX: 510.444.4493 - --------------------------------------------------------- --------------------------- From: dean@cs.mcgill.ca (Dean NEWTON) Subject: oopsDebug problem in THINK C 5.0.2 Date: 28 Feb 92 22:22:05 GMT Organization: SOCS, McGill University, Montreal, Canada When I build with the oopsDebug library, instead of oops, I get two undefined symbols: __noMethod and __noObject. I can't find them anywhere. I am using my own library of objects, not any of the ones in TCL. Thanks, Kaveh Kardan (posting from a friend's account) - ------------------------- From: wysocki@husc.harvard.edu (Chris Wysocki) Subject: oopsDebug problem in THINK C 5.0.2 Date: 29 Feb 92 01:08:32 GMT Organization: Harvard University, Cambridge, MA In article <1992Feb28.222205.22516@cs.mcgill.ca>, dean@cs.mcgill.ca (Dean NEWTON) writes: > When I build with the oopsDebug library, instead of oops, I get two > undefined symbols: __noMethod and __noObject. > > I can't find them anywhere. > > I am using my own library of objects, not any of the ones in TCL. Since you're not using the TCL, you'll need to write __noMethod and __noObject yourself. Here are the TCL's versions (from TCLUtilities.c): /****************************************************************************** __noObject Called by oopsDebug if message is sent to a bad object pointer/handler ******************************************************************************/ void __noObject(void) { Failure( paramErr, excMsgNullObject); } /****************************************************************************** __noMethod Called by oopsDebug if a message lookup fails ******************************************************************************/ void __noMethod(void) { Failure( paramErr, excMsgLookupFailed); } Chris Wysocki wysocki@husc.harvard.edu - ------------------------- From: plau@cs.albany.edu (Peter Lau) Subject: OopsDebug in THINK C 5.0.2... Date: 29 Feb 92 01:40:35 GMT Organization: Computer Science Department, SUNY at Albany, Albany, NY 12222 In article <PLAU.92Feb26193452@johnny.albany.edu> plau@cs.albany.edu (Peter Lau) writes: > I am trying things out on THINK C 5.0.2 and I come across with this > link error (by using the check link command)... > > undefined: __noMethod (oopsDebug) > undefined: __noObject (oopsDebug) > > I am in the Debugger mode, so I thought I should use the oopsDebug > instead of the oops... well, shouldn't I? Or oopsDebug is no longer > an valid module? I would like to thanks the following people who helped me on this one. David M Marcovitz <dmmg1176@uxa.cso.uiuc.edu> Russell S. Finn <rsfinn@concerto.lcs.mit.edu> d88-jwa@nada.kth.se Apparently OopsDebug should only used when you are using TCL. Somewhere inside TCL, those two functions were defined. Since I am not working with TCL, oops should be good enough. Thanks! :-) Peter --------------------------- From: kent@sunfs3.Camex.COM (Kent Borg) Subject: Powerbook Watch Organization: Camex Inc., Boston MA Date: Fri, 28 Feb 1992 17:21:06 EST Some of you might remembering seeing my comments about ordering a Powerbook through the developer hardware purchase program (those who don't know what that is, might just as well skip the rest of this article). Well, I finally got my Powerbook 140 2/20 yesterday, so here are some comments. First, I don't think Apple thinks developers are very important any more. The developer discounts have not only shrunk as Apple's margins got thinner, the absolute price charged to developers for things like hard disks have gone *up*. Second, Apple doesn't bother to ship computers to developers. I was told by people in Charlotte that they hadn't seen the 2/20 140 for more than two months. Third, Apple ain't too competent. The first computer they shipped me they shipped to a hybrid of the "Sold To" and "Ship To" addresses. As a result, the UPS Gorillas didn't know how to deliver it, so they stole it. (The extra battery was shipped separately in a plain brown wrapper, so it got returned to sender and reshipped to the correct address. I've had it for months. Whoopie!) Fourth, once they shipped it to the wrong address it took many phone calls and and several weeks for them to finally do a trace on the package, to finally get word that it was lost, and finally get the claim forms filled out by UPS. Fifth, the published numbers for developers to call in Charlotte never seem to be answered by people. I always seem to get voice mail messages, I leave a message, and I sometimes get an answer. I mailed my certified check November 8, 1991. I got my computer February 28, 1992. I don't consider that to be respectable. How is the computer itself? Don't really know yet. Maybe I'll post comments about it sometime soon. (Do I sound bitter? I wonder why...) -- Kent Borg internet: kent@camex.com AOL: kent borg H:(617) 776-6899 W:(617) 426-3577 "Eating healthy beef is not healthful, the steer will take offense at you chewing on his flanks." -me - ------------------------- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy) Subject: Powerbook Watch Organization: Kalamazoo College Date: Sat, 29 Feb 1992 21:26:16 GMT In article <1992Feb28.172106.2279@sunfs3.Camex.COM> kent@sunfs3.Camex.COM (Kent Borg) writes: > >Second, Apple doesn't bother to ship computers to developers. I was >told by people in Charlotte that they hadn't seen the 2/20 140 for >more than two months. > >Third, Apple ain't too competent. The first computer they shipped me >they shipped to a hybrid of the "Sold To" and "Ship To" addresses. > >Fifth, the published numbers for developers to call in Charlotte never >seem to be answered by people. I always seem to get voice mail >messages, I leave a message, and I sometimes get an answer. > >(Do I sound bitter? I wonder why...) I understand your bitterness. It sounds like you got a really raw deal. But my experience was somewhat better. The Charlotte people told me the IIci, IIsi, and LC were backordered two to six weeks. I got the IIci and LC on time; the IIsi should be here any day now. When Apple dropped the prices on February 3rd, they sent us an update to the invoice, indicating a reduced price on the IIsi. (The already-shipped IIci, they charged the old price for.) They actually mailed the new invoice February 2nd. That was nice. It took me two tries to get through to the Charlotte people; I left messages both times, and the second time I was called back within the hour. >"Eating healthy beef is not healthful, the steer will take offense at you >chewing on his flanks." -me Very true. -- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy Kzoo randomly kills all my mail; if I don't acknowledge, try resending. --------------------------- End of C.S.M.P. Digest **********************